﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the GNU General Public License version 2 (GPLv2).
// See accompanying file License.txt or copy at http://phuse.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Phuse.Net.Forums
{
    using System;

    /// <summary>Exposes the methods supported by persistent objects that can be deleted.</summary>
    /// <threadsafety static="true" instance="false"/>
    public interface IDeletablePersistentObject
    {
        /// <summary>Removes from the cache the information represented by this object.</summary>
        /// <exception cref="InvalidOperationException"><see cref="Cache.Dispose"/> has been called on the parent
        /// <see cref="Cache"/> object, or, <see cref="Delete"/> has already been called on this or a parent object.
        /// </exception>
        /// <remarks>
        /// <para><strong>Note</strong>: After calling this method, the next call to <see cref="Cache.SaveChanges"/> on
        /// the parent <see cref="Cache"/> object will return <c>true</c>.</para>
        /// <para>Automatically also removes from the cache all information that has possibly been added with child
        /// objects.</para>
        /// </remarks>
        void Delete();
    }
}
